package com.lfy.domain;

import com.lfy.modules.common.domain.BaseChatVO;
import com.lfy.modules.common.utils.JsonUtils;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;

import static com.lfy.modules.common.domain.BaseChatVO.getEndChattingVO;
import static com.lfy.modules.common.domain.BaseChatVO.getExceptionVO;

public class BuilderChatResult {
    public static TextWebSocketFrame getAIResponseVO(BaseChatVO<?> data) {
        return new TextWebSocketFrame(JsonUtils.toStr(data));
    }
    public static TextWebSocketFrame getAiEndResponseVO(Integer groupId,Integer modelId) {
        return new TextWebSocketFrame(JsonUtils.toStr(getEndChattingVO(groupId,modelId)));
    }

    public static TextWebSocketFrame getAiExceptionResponseVO(String message,Integer groupId,Integer modelId) {
        return new TextWebSocketFrame(JsonUtils.toStr(getExceptionVO(message,groupId,modelId)));
    }
}
